package cn.rongdao.jrkabao.ui.cashadvance.uicomponent;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import com.mifengkong.frtools.util.FRCollection;

import cn.rongdao.jrkabao.R;

/**
 * Created by jack on 2017/9/9
 */

public class CashBankCardUIComponent extends LinearLayout {

    public CashBankCardUIComponent(Context context) {
        super(context);
    }

    public CashBankCardUIComponent(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public CashBankCardUIComponent(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private ItemBankCardUIComponent llCreditCard;
    private ItemBankCardUIComponent llDepositCard;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        llCreditCard = findViewById(R.id.lcbc_credit_card);
        llDepositCard = findViewById(R.id.lcbc_depodit_card);
        llCreditCard.setCardName("取现信用卡：");
        llDepositCard.setCardName("到账储蓄卡：");
    }


    public void setOnCreditClickListener(OnClickListener onCreditClickListener) {
        llCreditCard.setOnClickListener(onCreditClickListener);
    }

    public void setOnDepositClickListener(OnClickListener onCreditClickListener) {
        llDepositCard.setOnClickListener(onCreditClickListener);
    }

    public void setCreditContent(String creditCard, String bankNumber, String imageUrl) {
        llCreditCard.setAddCardName(FRCollection.appendAsString(creditCard, "(", bankNumber, ")", ""), imageUrl, 1);
    }

    public void setDepositContent(String depositCard, String bankNumber, String imageUrl) {
        llDepositCard.setAddCardName(FRCollection.appendAsString(depositCard, "(", bankNumber, ")", ""), imageUrl, 2);
    }
}
